﻿@model IEnumerable<WebUI.Models.SmsTemplate>
@{ var tm = new WebUI.Models.SmsTemplate();}
 
@using (Ajax.BeginForm("SmsTempLateList", new { IsView = false }, new AjaxOptions { HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "main", OnFailure = "OnSiteError" }))
{
    <div class="toolbox">
    <fieldset>   
        <legend>
        <div class="catalog-title">
                模板&nbsp; &nbsp;
                @Ajax.ActionLink("[新建]", "SmsTemplateEdit", new { _utid = "ListView" }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('短信模板');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                </div>
                </legend>
        <div class="editor-label">
                模板类型：
                @Html.DropDownList("smsType", new List<SelectListItem>()
                    {
                        new SelectListItem(){ Value = "发起邀请",Text = "发起邀请" },
                            new SelectListItem(){ Value = "短信催报",Text = "短信催报" },
                            new SelectListItem(){ Value = "短信随访开始问候语",Text = "短信随访开始问候语" },
                            new SelectListItem(){ Value = "短信随访",Text = "短信随访" },
                            new SelectListItem(){ Value = "诊断异常短信",Text = "诊断异常短信" },
                            new SelectListItem(){ Value = "诊断正常短信",Text = "诊断正常短信" },
                            new SelectListItem(){ Value = "结束语",Text = "结束语" },
                            new SelectListItem(){ Value = "短信留言",Text = "短信留言" },
                    }, "全部")
                @Helpers.SubmitButton("查询", "qssubmit")
                
    </div>
    </fieldset>
    </div>
}
<table class="width">
    <tr>
        <th>
            @Html.LabelFor(model => tm.Type)
        </th>
        <th>
            @Html.LabelFor(model => tm.SmsText)
        </th>
        <th>
            @Html.Label("操作")
        </th>        
    </tr>
    @{int dColor = 0;}
    @foreach (var item in Model)
    {
        <tr class="tr-backColor@(dColor++%2)">
            <td>
                @Html.DisplayFor(model => item.Type)
            </td>
            <td>
                @Html.DisplayFor(model => item.SmsText)
            </td>            
            <td>
                @Ajax.ActionLink("修改", "SmsTemplateEdit", new { ID = item.ID, _utid = "ListView" }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('患者信息');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                @Ajax.ActionLink("删除", "SmsTemplateDelete", new { ID = item.ID, _t = DateTime.Now.Ticks }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "ListView", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() })
            </td>
        </tr>
    }
</table>
@Html.Partial("TrHilighter")